<?php
@require_once("config.php");
$usertel=$_GET["usertel"];
$userpwd=$_GET["userpwd"];
$str="select count(*) from giftuserinfo where usertel='$usertel'";
$result=mysql_query($str);
$item=mysql_fetch_array($result);
$obj=array();
if($item[0]>0){
    $obj["code"]=0;
    $obj["msg"]="手机号已存在";
}else{
    $str1="insert into giftuserinfo(usertel,userpwd) values('$usertel','$userpwd')";
    mysql_query($str1);
    $count=mysql_affected_rows();
    if($count>0){
        $obj["code"]=1;
        $obj["msg"]="注册成功";

    }else{
        $obj["code"]=0;
        $obj["msg"]="注册失败";
    }
}
echo json_encode($obj);

?>